﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RendicionGastos.Models;

namespace RendicionGastos.Controllers
{
        [Authorize(Roles = "Administrador")]
    public class ReportController : Controller
    {
        private List<ReportData> CreateReportDate()
        {
            {
                List<ReportData> oListReportData = new List<ReportData>();

                oListReportData.Add(new ReportData()
                {
                    Concept = "Pasajes",
                    CostCenter = "Sistema",
                    DateEnd = DateTime.Now,
                    DateInitial = DateTime.Now,
                    DateExpense = DateTime.Now,
                    Employee = "Robert Wong Villar",
                    MountConcept = Convert.ToDecimal(10.00),
                    NumberVoucher = "F-000012",
                    Position = "Analista",
                    Supplier = "Toyota"
                });
                return oListReportData;
            }
        }
        private ReportData GetReportDate(string empleyee)
        {
            List<ReportData> oListReportData = (List<ReportData>) Session["oListReportData"];
            ReportData model = oListReportData.Single(delegate(ReportData item)
            {
                if (item.Employee == empleyee)
                {
                    return true;
                }
                else
                {
                    return false;
                }
                
            });
            return model;
        }

        //
        // GET: /Report/

        public ActionResult Index()
        {
            return View();
        }

        //
        // GET: /Report/Details/5

        public ActionResult Details(int id)
        {
            return View();
        }

        //
        // GET: /Report/Create

        public ActionResult Create()
        {
            return View();
        } 

        //
        // POST: /Report/Create

        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        
        //
        // GET: /Report/Edit/5
 
        public ActionResult Edit(int id)
        {
            return View();
        }

        //
        // POST: /Report/Edit/5

        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /Report/Delete/5
 
        public ActionResult Delete(int id)
        {
            return View();
        }

        //
        // POST: /Report/Delete/5

        [HttpPost]
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
    }
}
